#写文件操作

#my_open = open('talk.txt','a',encoding="utf-8")

#一定要加换行符

#my_open.write('你好\n')

#my_open.close()

# with open('talk.txt','a',encoding="utf-8") as f:
#     f.write('上下文管理器\n')

#读文件操作

result = []
with open('talk.txt','r',encoding="utf-8") as f:
    for line in f.readlines():
        #print(line)
        result.append(line.replace("\n",""))

print(result)